<?php
    jimport( 'joomla.application.component.view');
    class VolunteerViewFiledetail extends JView
    {
		function display($tpl = null)
		{
			$model = $this->getModel('volunteer'); //get default model
						
			//get POST/GET parameters' value
			$fileId = JRequest::getVar('fileid');
			if($fileId)
			{
				$file = $model->getFile($fileId);
				
				$this->assign( 'file', $file);
				
				$app = JFactory::getApplication();
				$data = $app->getUserState('volunteer.filedetail.form.data');
					
				$this->assignRef( 'linkToFile', $data['linkToFile']);
				
				$this->assign( 'location', $model->getLocation($file->location_id)->location);
				$this->assign( 'timespan', $model->getTimespan($file->timespan_id)->timespan);
				$this->assign( 'industry', $model->getIndustry($file->industry_id)->industry);
				$this->assign( 'keywords', $model->getFileKeywords($fileId));
			}
			
			parent::display($tpl); //display defaul template
		}
    }